$(function(){
  var currencies = [
{ value: 'Afghanistan', data: 'Afghanistan' },
{ value: 'Algeria', data: 'Algeria' },
{ value: 'Andorra', data: 'Andorra' },
{ value: 'Angola', data: 'Angola' },
{ value: 'Anguilla', data: 'Anguilla' },
{ value: 'Antigua and Barbuda', data: 'Antigua and Barbuda' },
{ value: 'Argentina', data: 'Argentina' },
{ value: 'Armenia', data: 'Armenia' },
{ value: 'Aruba', data: 'Aruba' },
{ value: 'Australia', data: 'Australia' },
{ value: 'Austria', data: 'Austria' },
{ value: 'Azerbaijan', data: 'Azerbaijan' },
{ value: 'Bahamas', data: 'Bahamas' },
{ value: 'Bahrain', data: 'Bahrain' },
{ value: 'Bangladesh', data: 'Bangladesh' },
{ value: 'Barbados', data: 'Barbados' },
{ value: 'Belarus', data: 'Belarus' },
{ value: 'Belgium', data: 'Belgium' },
{ value: 'Belize', data: 'Belize' },
{ value: 'Benin', data: 'Benin' },
{ value: 'Bermuda', data: 'Bermuda' },
{ value: 'Bhutan', data: 'Bhutan' },
{ value: 'Bolivia', data: 'Bolivia' },
{ value: 'Bosnia and Herzegovina', data: 'Bosnia and Herzegovina' },
{ value: 'Botswana', data: 'Botswana' },
{ value: 'Brazil', data: 'Brazil' },
{ value: 'Brunei', data: 'Brunei' },
{ value: 'Bulgaria', data: 'Bulgaria' },
{ value: 'Burkina Faso', data: 'Burkina Faso' },
{ value: 'Burundi', data: 'Burundi' },
{ value: 'Cambodia', data: 'Cambodia' },
{ value: 'Cameroon', data: 'Cameroon' },
{ value: 'Canada', data: 'Canada' },
{ value: 'Canaries', data: 'Canaries' },
{ value: 'Cape Verde', data: 'Cape Verde' },
{ value: 'Cayman Islands', data: 'Cayman Islands' },
{ value: 'Central African Republic', data: 'Central African Republic' },
{ value: 'Chad', data: 'Chad' },
{ value: 'Chile', data: 'Chile' },
{ value: 'China', data: 'China' },
{ value: 'Colombia', data: 'Colombia' },
{ value: 'Comoros', data: 'Comoros' },
{ value: 'Congo (Republic)', data: 'Congo (Republic)' },
{ value: 'Cook Islands', data: 'Cook Islands' },
{ value: 'Costa Rica', data: 'Costa Rica' },
{ value: 'Croatia', data: 'Croatia' },
{ value: 'Cuba', data: 'Cuba' },
{ value: 'Cyprus (North)', data: 'Cyprus (North)' },
{ value: 'Cyprus (South)', data: 'Cyprus (South)' },
{ value: 'Czech Republic', data: 'Czech Republic' },
{ value: 'Denmark', data: 'Denmark' },
{ value: 'Djibouti', data: 'Djibouti' },
{ value: 'Dominica', data: 'Dominica' },
{ value: 'Dominican Republic', data: 'Dominican Republic' },
{ value: 'Ecuador', data: 'Ecuador' },
{ value: 'Egypt', data: 'Egypt' },
{ value: 'El Salvador', data: 'El Salvador' },
{ value: 'Equatorial Guinea', data: 'Equatorial Guinea' },
{ value: 'Eritrea', data: 'Eritrea' },
{ value: 'Estonia', data: 'Estonia' },
{ value: 'Ethiopia', data: 'Ethiopia' },
{ value: 'Falkland Islands', data: 'Falkland Islands' },
{ value: 'Faroe Islands', data: 'Faroe Islands' },
{ value: 'Fiji', data: 'Fiji' },
{ value: 'Finland', data: 'Finland' },
{ value: 'France', data: 'France' },
{ value: 'French Guiana', data: 'French Guiana' },
{ value: 'Gabon', data: 'Gabon' },
{ value: 'Gambia', data: 'Gambia' },
{ value: 'Georgia', data: 'Georgia' },
{ value: 'Germany', data: 'Germany' },
{ value: 'Ghana', data: 'Ghana' },
{ value: 'Gibraltar', data: 'Gibraltar' },
{ value: 'Greece', data: 'Greece' },
{ value: 'Greenland', data: 'Greenland' },
{ value: 'Grenada', data: 'Grenada' },
{ value: 'Guadeloupe', data: 'Guadeloupe' },
{ value: 'Guam', data: 'Guam' },
{ value: 'Guatemala', data: 'Guatemala' },
{ value: 'Guinea', data: 'Guinea' },
{ value: 'Guinea-Bissau', data: 'Guinea-Bissau' },
{ value: 'Guyana', data: 'Guyana' },
{ value: 'Haiti', data: 'Haiti' },
{ value: 'Hawaii', data: 'Hawaii' },
{ value: 'Honduras', data: 'Honduras' },
{ value: 'Hong Kong', data: 'Hong Kong' },
{ value: 'Hungary', data: 'Hungary' },
{ value: 'Iceland', data: 'Iceland' },
{ value: 'India', data: 'India' },
{ value: 'Indonesia', data: 'Indonesia' },
{ value: 'Iran', data: 'Iran' },
{ value: 'Ireland', data: 'Ireland' },
{ value: 'Israel', data: 'Israel' },
{ value: 'Italy', data: 'Italy' },
{ value: 'Jamaica', data: 'Jamaica' },
{ value: 'Japan', data: 'Japan' },
{ value: 'Jordan', data: 'Jordan' },
{ value: 'Kazakhstan', data: 'Kazakhstan' },
{ value: 'Kenya', data: 'Kenya' },
{ value: 'Korea (North)', data: 'Korea (North)' },
{ value: 'Korea (South)', data: 'Korea (South)' },
{ value: 'Kosovo', data: 'Kosovo' },
{ value: 'Kuwait', data: 'Kuwait' },
{ value: 'Kyrgyzstan', data: 'Kyrgyzstan' },
{ value: 'Laos', data: 'Laos' },
{ value: 'Latvia', data: 'Latvia' },
{ value: 'Lebanon', data: 'Lebanon' },
{ value: 'Lesotho', data: 'Lesotho' },
{ value: 'Liberia', data: 'Liberia' },
{ value: 'Libya', data: 'Libya' },
{ value: 'Liechtenstein', data: 'Liechtenstein' },
{ value: 'Lithuania', data: 'Lithuania' },
{ value: 'Luxembourg', data: 'Luxembourg' },
{ value: 'Macau', data: 'Macau' },
{ value: 'Macedonia', data: 'Macedonia' },
{ value: 'Madagascar', data: 'Madagascar' },
{ value: 'Malawi', data: 'Malawi' },
{ value: 'Malaysia', data: 'Malaysia' },
{ value: 'Maldives', data: 'Maldives' },
{ value: 'Mali', data: 'Mali' },
{ value: 'Malta', data: 'Malta' },
{ value: 'Marshall Islands', data: 'Marshall Islands' },
{ value: 'Martinique', data: 'Martinique' },
{ value: 'Mauritania', data: 'Mauritania' },
{ value: 'Mauritius', data: 'Mauritius' },
{ value: 'Mayotte', data: 'Mayotte' },
{ value: 'Mexico', data: 'Mexico' },
{ value: 'Micronesia, Federated States Of', data: 'Micronesia, Federated States Of' },
{ value: 'Moldova', data: 'Moldova' },
{ value: 'Monaco', data: 'Monaco' },
{ value: 'Mongolia', data: 'Mongolia' },
{ value: 'Montenegro', data: 'Montenegro' },
{ value: 'Montserrat', data: 'Montserrat' },
{ value: 'Morocco', data: 'Morocco' },
{ value: 'Mozambique', data: 'Mozambique' },
{ value: 'Myanmar (Burma)', data: 'Myanmar (Burma)' },
{ value: 'Namibia', data: 'Namibia' },
{ value: 'Nauru', data: 'Nauru' },
{ value: 'Nepal', data: 'Nepal' },
{ value: 'Netherlands', data: 'Netherlands' },
{ value: 'New Caledonia', data: 'New Caledonia' },
{ value: 'New Zealand', data: 'New Zealand' },
{ value: 'Nicaragua', data: 'Nicaragua' },
{ value: 'Niger', data: 'Niger' },
{ value: 'Nigeria', data: 'Nigeria' },
{ value: 'Niue', data: 'Niue' },
{ value: 'Norfolk Island', data: 'Norfolk Island' },
{ value: 'Norway', data: 'Norway' },
{ value: 'Oman', data: 'Oman' },
{ value: 'Pakistan', data: 'Pakistan' },
{ value: 'Palau', data: 'Palau' },
{ value: 'Panama', data: 'Panama' },
{ value: 'Papua New Guinea', data: 'Papua New Guinea' },
{ value: 'Paraguay', data: 'Paraguay' },
{ value: 'Peru', data: 'Peru' },
{ value: 'Philippines', data: 'Philippines' },
{ value: 'Poland', data: 'Poland' },
{ value: 'Portugal', data: 'Portugal' },
{ value: 'Puerto Rico', data: 'Puerto Rico' },
{ value: 'Qatar', data: 'Qatar' },
{ value: 'Reunion', data: 'Reunion' },
{ value: 'Romania', data: 'Romania' },
{ value: 'Russia', data: 'Russia' },
{ value: 'Rwanda', data: 'Rwanda' },
{ value: 'Samoa', data: 'Samoa' },
{ value: 'San Marino', data: 'San Marino' },
{ value: 'Sao Tome and Principe', data: 'Sao Tome and Principe' },
{ value: 'Saudi Arabia', data: 'Saudi Arabia' },
{ value: 'Senegal', data: 'Senegal' },
{ value: 'Serbia', data: 'Serbia' },
{ value: 'Seychelles', data: 'Seychelles' },
{ value: 'Sierra Leone', data: 'Sierra Leone' },
{ value: 'Singapore', data: 'Singapore' },
{ value: 'Slovakia', data: 'Slovakia' },
{ value: 'Slovenia', data: 'Slovenia' },
{ value: 'Solomon Islands', data: 'Solomon Islands' },
{ value: 'Somalia', data: 'Somalia' },
{ value: 'South Africa', data: 'South Africa' },
{ value: 'Spain', data: 'Spain' },
{ value: 'Sri Lanka', data: 'Sri Lanka' },
{ value: 'Sudan', data: 'Sudan' },
{ value: 'Suriname', data: 'Suriname' },
{ value: 'Swaziland', data: 'Swaziland' },
{ value: 'Sweden', data: 'Sweden' },
{ value: 'Switzerland', data: 'Switzerland' },
{ value: 'Syria', data: 'Syria' },
{ value: 'Taiwan', data: 'Taiwan' },
{ value: 'Tajikistan', data: 'Tajikistan' },
{ value: 'Tanzania', data: 'Tanzania' },
{ value: 'Thailand', data: 'Thailand' },
{ value: 'Togo', data: 'Togo' },
{ value: 'Tokelau', data: 'Tokelau' },
{ value: 'Tonga', data: 'Tonga' },
{ value: 'Trinidad and Tobago', data: 'Trinidad and Tobago' },
{ value: 'Tunisia', data: 'Tunisia' },
{ value: 'Turkey', data: 'Turkey' },
{ value: 'Turkmenistan', data: 'Turkmenistan' },
{ value: 'Turks and Caicos Islands', data: 'Turks and Caicos Islands' },
{ value: 'Tuvalu', data: 'Tuvalu' },
{ value: 'Uganda', data: 'Uganda' },
{ value: 'Ukraine', data: 'Ukraine' },
{ value: 'United Arab Emirates', data: 'United Arab Emirates' },
{ value: 'United Kingdom', data: 'United Kingdom' },
{ value: 'United States of America', data: 'United States of America' },
{ value: 'Uruguay', data: 'Uruguay' },
{ value: 'Uzbekistan', data: 'Uzbekistan' },
{ value: 'Vanuatu', data: 'Vanuatu' },
{ value: 'Venezuela', data: 'Venezuela' },
{ value: 'Vietnam', data: 'Vietnam' },
{ value: 'Virgin Islands', data: 'Virgin Islands' },
{ value: 'Wallis And Futuna', data: 'Wallis And Futuna' },
{ value: 'Yemen', data: 'Yemen' },
{ value: 'Zambia', data: 'Zambia' },
{ value: 'Zimbabwe', data: 'Zimbabwe' },
  ];
  
  // setup autocomplete function pulling from currencies[] array
  $('#autocomplete').autocomplete({
    lookup: currencies,
    onSelect: function (suggestion) {
      var thehtml = '<strong>Country:</strong> ' + suggestion.value;
      $('#outputcontent').html(thehtml);
    }
  });
  

});